import Vue from 'vue'
import VueRouter from 'vue-router'
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function (location) {
  try {
    return originalPush.call(this, location).catch(err => err);
  } catch (error) {
    console.error(error);
  }
};
import ElementUI from 'element-ui'
import echarts from 'echarts'
import App from '@app/App.vue'
import store from '@store/app.js'
import dataV from '@jiaminghi/data-view'
import global from '@service/global.js'
import annyang from 'annyang'
Vue.prototype.$global = global
Vue.prototype.$annyang = annyang
//安装ajax依赖
import axios from 'axios'
import proposal_ from './api/api.js';
Vue.prototype.$axios = axios;
Vue.prototype.proposal = proposal_ //axios实例
import htmlToPdf from '@/utils/htmlToPdf'
Vue.use(htmlToPdf)


    // import 'element-ui/lib/theme-chalk/index.css'
Vue.use(VueRouter)

Vue.use(ElementUI)
Vue.use(dataV)
Vue.config.productionTip = false
Vue.prototype.$echarts = echarts
const root = document.createElement('div')
document.body.appendChild(root)

document.onkeydown = function(e) {
    const event = window.event || e
    const code = event.keyCode || event.which
    if (code === 116) {
        if (event.preventDefault) {
            event.preventDefault()
        } else {
            event.keyCode = 0
            event.returnValue = false
        }
        return false
    }
}
new Vue({
    store,
    router: new VueRouter({
        // mode: 'history',
        // routes: [{
        //   path: '/',
        //   component: App
        // }]
    }),
    render: h => h(App)
}).$mount(root)